//Design By Do Trung --- Email : trungqn19852003@yahoo.com
//Ngày Design :5/4/2011 5:00:32 PM
using System;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Linq;
using System.Collections.Generic;
 
    /// <summary>
	/// </summary>
	public class HinhAnh_BA
	{
		public HinhAnh_BA() {}
#region 'Variables And Properties'
		 private int int_IdHinhAnh ;
		 public int IdHinhAnh
			{
			 get 	
				{
					 return this.int_IdHinhAnh;
				}
			 set 	
				{
					int_IdHinhAnh=value;
				}
			}
		 private int int_IDChuyenMuc ;
		 public int IDChuyenMuc
			{
			 get 	
				{
					 return this.int_IDChuyenMuc;
				}
			 set 	
				{
					int_IDChuyenMuc=value;
				}
			}
		 private string string_TenFile ;
		 public string TenFile
			{
			 get 	
				{
					 return this.string_TenFile;
				}
			 set 	
				{
					string_TenFile=value;
				}
			}
		 private string string_TenHienThi ;
		 public string TenHienThi
			{
			 get 	
				{
					 return this.string_TenHienThi;
				}
			 set 	
				{
					string_TenHienThi=value;
				}
			}
		 private string string_MoTa ;
		 public string MoTa
			{
			 get 	
				{
					 return this.string_MoTa;
				}
			 set 	
				{
					string_MoTa=value;
				}
			}
		 private string string_NgayUpload ;
		 public string NgayUpload
			{
			 get 	
				{
					 return this.string_NgayUpload;
				}
			 set 	
				{
					string_NgayUpload=value;
				}
			}
		 private string string_NgayCapNhat ;
		 public string NgayCapNhat
			{
			 get 	
				{
					 return this.string_NgayCapNhat;
				}
			 set 	
				{
					string_NgayCapNhat=value;
				}
			}
		 private bool bool_TrangThai ;
		 public bool TrangThai
			{
			 get 	
				{
					 return this.bool_TrangThai;
				}
			 set 	
				{
					bool_TrangThai=value;
				}
			}
		 private string string_TenDangNhap ;
		 public string TenDangNhap
			{
			 get 	
				{
					 return this.string_TenDangNhap;
				}
			 set 	
				{
					string_TenDangNhap=value;
				}
			}
#endregion

		/// <summary>
		/// Inserts a record into the HinhAnh table.
		/// <summary>
		/// <param name="IdHinhAnh"></param>
		/// <param name="IDChuyenMuc"></param>
		/// <param name="TenFile"></param>
		/// <param name="TenHienThi"></param>
		/// <param name="MoTa"></param>
		/// <param name="NgayUpload"></param>
		/// <param name="NgayCapNhat"></param>
		/// <param name="TrangThai"></param>
		/// <param name="TenDangNhap"></param>
		/// <returns></returns>
		public bool Insert(SqlConnection SqlCnn)
		{
			bool boolInsert = false ;
			HinhAnh_DA clsDA_HinhAnh = new HinhAnh_DA();
			clsDA_HinhAnh.IdHinhAnh=int_IdHinhAnh;
			clsDA_HinhAnh.IDChuyenMuc=int_IDChuyenMuc;
			clsDA_HinhAnh.TenFile=string_TenFile;
			clsDA_HinhAnh.TenHienThi=string_TenHienThi;
			clsDA_HinhAnh.MoTa=string_MoTa;
			clsDA_HinhAnh.NgayUpload=string_NgayUpload;
			clsDA_HinhAnh.NgayCapNhat=string_NgayCapNhat;
			clsDA_HinhAnh.TrangThai=bool_TrangThai;
			clsDA_HinhAnh.TenDangNhap=string_TenDangNhap;

			boolInsert = clsDA_HinhAnh.Insert(SqlCnn);
			clsDA_HinhAnh = null ;
			return boolInsert;
		}

		/// <summary>
		/// Selects a single record from the HinhAnh table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable Select(SqlConnection SqlCnn)
		{
			HinhAnh_DA clsDA_HinhAnh = new HinhAnh_DA();
			DataTable dt = new DataTable();
			dt=clsDA_HinhAnh.Select(SqlCnn);
			clsDA_HinhAnh= null ;
			return dt;
		}

		/// <summary>
		/// Selects a single record from the HinhAnh table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable SelectPrimaryKey(SqlConnection SqlCnn)
		{
			HinhAnh_DA clsDA_HinhAnh = new HinhAnh_DA();
			DataTable dt = new DataTable();
			clsDA_HinhAnh.IdHinhAnh=int_IdHinhAnh;

			dt=clsDA_HinhAnh.SelectPrimaryKey(SqlCnn);
			clsDA_HinhAnh= null;
			return dt;
			}

		/// <summary>
		/// Updates a record in the HinhAnh table.
		/// <summary>
		/// <param name="IdHinhAnh"></param>
		/// <param name="IDChuyenMuc"></param>
		/// <param name="TenFile"></param>
		/// <param name="TenHienThi"></param>
		/// <param name="MoTa"></param>
		/// <param name="NgayUpload"></param>
		/// <param name="NgayCapNhat"></param>
		/// <param name="TrangThai"></param>
		/// <param name="TenDangNhap"></param>
		public bool Update(SqlConnection SqlCnn)
		{
			bool boolUpdate = false ;
			HinhAnh_DA clsDA_HinhAnh = new HinhAnh_DA();
			clsDA_HinhAnh.IdHinhAnh=int_IdHinhAnh;
			clsDA_HinhAnh.IDChuyenMuc=int_IDChuyenMuc;
			clsDA_HinhAnh.TenFile=string_TenFile;
			clsDA_HinhAnh.TenHienThi=string_TenHienThi;
			clsDA_HinhAnh.MoTa=string_MoTa;
			clsDA_HinhAnh.NgayUpload=string_NgayUpload;
			clsDA_HinhAnh.NgayCapNhat=string_NgayCapNhat;
			clsDA_HinhAnh.TrangThai=bool_TrangThai;
			clsDA_HinhAnh.TenDangNhap=string_TenDangNhap;

			boolUpdate = clsDA_HinhAnh.Update(SqlCnn);
			clsDA_HinhAnh = null ;
			return boolUpdate;
		}

		/// <summary>
		/// Deletes a record from the HinhAnh table by a composite primary key.
		/// <summary>
		public bool Delete(SqlConnection SqlCnn)
		{
			bool boolDelete = false ;
			HinhAnh_DA clsDA_HinhAnh = new HinhAnh_DA();
			clsDA_HinhAnh.IdHinhAnh=int_IdHinhAnh;

			boolDelete = clsDA_HinhAnh.Delete(SqlCnn);
			clsDA_HinhAnh = null ;
			return boolDelete;
		}
	}
